#!/bin/bash
# userlist.sh

PASSWORD_FILE=/etc/passwd
n=1           # User number

for name in $(awk 'BEGIN { FS=":" } { print $1 }' < "$PASSWORD_FILE" )
do
  echo "USER #$n = $name"
  let "n += 1"
done  

exit 0

#  Exercise:
#  --------
#  How is it that an ordinary user (or a script run by same)
#+ can read /etc/passwd?
#  Isn't this a security hole? Why or why not?
